<?php
namespace app\api\controller\foodcash;

use app\api\controller\foodcash\Controller;
use app\api\model\foodcash\Table as TableModel;

/**
 * 餐桌/包间控制器
 */
class Table extends Controller
{
    /**
     * 列表
     */
    public function lists($status=0)
    {
		$model = new TableModel;
        $list = $model->getList($this->shop_id,$status);
        return $this->renderSuccess(compact('list'));
    }
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    /**
     * 详情
     */
    public function detail($table_id)
    {
		if ($detail = TableModel::get($table_id,['shop'])) {
            return $this->renderSuccess(compact('detail'));
        }
        return $this->renderError('餐桌/包间不存在');
    }
}
